package cn.imvc.app.domains;

import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;

//10现金充值   11加盟分佣  12订单分佣 
//20提现 21提现失败退款  
//30购买商品扣款 31购买商品退款  
//40分销商升级
//50购买商品积分增加 51积分减少
//60推荐会员 61订单积分分佣
//70积分兑换现金积分减 71积分兑换现金资金加
public enum FundFlowType {
	Recharge(10) {
		public String toString() {
			return "现金充值";
		}
	},
	JoinCommissions(11) {
		public String toString() {
			return "加盟分佣";
		}
	},
	OrderCommissions(12) {
		public String toString() {
			return "订单分佣";
		}
	},
	TeamAward(13){
		public String toString() {
			return "团队奖励";
		}
	},
	Withdrawals(20) {
		public String toString() {
			return "提现";
		}
	},
	WithdrawalsFailed(21) {
		public String toString() {
			return "提现失败退款";
		}
	},
	Buy(30) {
		public String toString() {
			return "购买商品扣款";
		}
	},
	Refund(31) {
		public String toString() {
			return "购买商品退款";
		}
	},
	BuyRecharge(32) {
		public String toString() {
			return "购买商品充值";
		}
	},
	Upgrade(40) {
		public String toString() {
			return "分销商升级";
		}
	},
	UpgradeRecharge(41) {
		public String toString() {
			return "分销商升级充值";
		}
	},
	PointsUp(50) {
		public String toString() {
			return "购买商品积分增加";
		}
	},
	PointsDown(51) {
		public String toString() {
			return "积分减少";
		}
	},
	PointsRecommend(60) {
		public String toString() {
			return "推荐会员";
		}
	},
	PointsCommission(61) {
		public String toString() {
			return "订单积分分佣";
		}
	},
	PointsToMoney_Points(70) {
		public String toString() {
			return "积分兑换现金积分减";
		}
	},
	PointsToMoney_Money(71) {
		public String toString() {
			return "积分兑换现金资金加";
		}
	};

	private final Byte val;

	FundFlowType(int n) {
		val = (byte) n;
	}

	public Byte getValue() {
		return val;
	}

	public static FundFlowType getByIntValue(int n) {
		switch (n) {
		case 10:
			return Recharge;
		case 11:
			return JoinCommissions;
		case 12:
			return OrderCommissions;
		case 13:
			return TeamAward;
		case 20:
			return Withdrawals;
		case 21:
			return WithdrawalsFailed;
		case 30:
			return Buy;
		case 31:
			return Refund;
		case 32:
			return BuyRecharge;
		case 40:
			return Upgrade;
		case 41:
			return UpgradeRecharge;
		case 50:
			return PointsUp;
		case 51:
			return PointsDown;
		case 60:
			return PointsRecommend;
		case 61:
			return PointsCommission;
		case 70:
			return PointsToMoney_Points;
		case 71:
			return PointsToMoney_Money;
		default:
			return null;
		}
	}
	


    public static final Map<Byte, String> elMap = new HashMap<Byte, String>();  
  
    static {  
        for (FundFlowType s : EnumSet.allOf(FundFlowType.class)) {  
        	elMap.put(s.getValue(), s.toString());  
        }  
    }
}